package com.seven.domain;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
import lombok.Data;

@Data
public class PageInfo<T> {

  private Long count;

  private List<T> rows;

  public static <T> PageInfo<T> of(Page<T> page) {
    PageInfo<T> tPageInfo = new PageInfo<>();
    tPageInfo.setRows(page.getRecords());
    tPageInfo.setCount(page.getTotal());
    return tPageInfo;
  }

}
